// pages/promotion/index/index.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    navList: [
      {
        id: 1,
        icon: '/images/icon_franchiseeManagement.png',
        name: '活动管理',
        url: '../projectLists/projectLists',
        status: true
      },
      {
        id: 2,
        icon: '/images/icon_cardManagement.png',
        name: '新增活动', 
        url: '../projectAdd/projectAdd?type=2',
        status: true
      },
      {
        id: 3,
        icon: '/images/icon_performanceManagement.png',
        name: '促销记录',
        url: '../record/record',
        status: true
      }
    ],
    count_data:[],
  },



  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.getIndex();
  },


  getIndex(){
    var that = this;
    app.ajax({
      url: 'Partner/Promotion/getPromotionMoney',
      method: "POST",
      data: {},
      success: function (res) {
        if (res.data.code == 1000) {
          that.setData({
            count_data: res.data.data
          })
        } else {
          app.showToast(res.data.message);
        }
      }
    })
  },
})